//
//  SixedChapterViewController.m
//  CoreAnimation
//
//  Created by 张国文 on 16/10/25.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "SixedChapterViewController.h"
#import "CATranscationViewController.h"
#import "LayerActionViewController.h"
#import "PresentLayerAndModelLayerViewController.h"

@interface SixedChapterViewController ()

@end

@implementation SixedChapterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom];
    firstButton.frame = CGRectMake(0, 20, 300, 50);
    [firstButton setTitle:@"CATransaction-事务" forState:UIControlStateNormal];
    [firstButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    firstButton.tag = 100;
    [firstButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:firstButton];
    
    UIButton *sectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sectionButton.frame = CGRectMake(0, 70, 300, 50);
    [sectionButton setTitle:@"关联图层" forState:UIControlStateNormal];
    [sectionButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    sectionButton.tag = 101;
    [sectionButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sectionButton];
//
//    
    UIButton *thirdButton = [UIButton buttonWithType:UIButtonTypeCustom];
    thirdButton.frame = CGRectMake(0, 120, 300, 50);
    [thirdButton setTitle:@"呈现图层和模型图层" forState:UIControlStateNormal];
    [thirdButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    thirdButton.tag = 102;
    [thirdButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:thirdButton];
//
//    UIButton *fourthButton = [UIButton buttonWithType:UIButtonTypeCustom];
//    fourthButton.frame = CGRectMake(0, 170, 300, 50);
//    [fourthButton setTitle:@"CATransformLayer" forState:UIControlStateNormal];
//    [fourthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
//    fourthButton.tag = 103;
//    [fourthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:fourthButton];

}

- (void)clickJump:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
            CATranscationViewController *catransactionVC = [[CATranscationViewController alloc] init];
            [self.navigationController pushViewController:catransactionVC animated:YES];
            break;
        }
            case 101:
        {
            LayerActionViewController *layerActionVC = [[LayerActionViewController alloc] init];
            [self.navigationController pushViewController:layerActionVC animated:YES];
            break;
        }
            case 102:
        {
            PresentLayerAndModelLayerViewController *presentLayerAndModelLayerVC = [[PresentLayerAndModelLayerViewController alloc] init];
            [self.navigationController pushViewController:presentLayerAndModelLayerVC animated:YES];
            break;
        }
        default:
            break;
    }
}

@end
